package gui;

import static config.ClojureInitialization.initializeClojureScipts;
import gui.factory.ChartFactory;
import gui.factory.SpecialJComboBoxFactory;
import gui.factory.SpecialSelectionListFactory;
import iface.ChartInfo;

import java.awt.Color;
import java.awt.EventQueue;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

import javax.swing.DefaultListModel;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JSlider;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.SwingConstants;
import javax.swing.border.LineBorder;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;

import sil.ChartInfoExtractor;
import sil.SilhouetteProbabilityCalculation;
import sil.mod.AttackModifiers;
import sil.mod.AttackModifiers.CoverModificator;
import sil.mod.AttackModifiers.RangeModificator;
import sil.mod.DefenseModifiers;
import sil.mod.DefenseModifiers.CircumstanceModificator;
import sil.mod.factory.ModifierFactory;
import builder.ProbabilityParameterBuilder;
import container.ProbabilityContainer;
import container.ProbabilityParameters;
import definition.Dice;

/**
 * Graphical User Interface class for calculating the probability of MoS or
 * causing a certain number of damage boxes.
 * 
 * <p>The GUI was designed by using Google WindowsBuilder PRO.</p> 
 * 
 * @author Marcus Lindner
 * @author Joana Otetelisanu
 */
public class ProbabilityCalculator {

    /** Time for a double-click. 500 milliseconds. */
    protected static final long DOUBLE_CLICK_TIME = 500;

    /**
     * Launch the application.
     * 
     * @param args any passed arguments are ignored
     */
    public static void main(String[] args) {
	EventQueue.invokeLater(new Runnable() {
	    @Override
	    public void run() {
		// Loading clojure scripts during the initialization of the program.
		// This is better as to start the clojure environment somewhere in the program
		// and create a waiting period, which occurs only once.
		initializeClojureScipts();

		final ProbabilityCalculator window = new ProbabilityCalculator();
		window.frame.setVisible(true);
	    }
	});
    }

    /**
     * Field frame.
     */
    JFrame frame;
    /**
     * Field dm_slider.
     */
    private JSlider attackDmSlider;
    /**
     * Field movement_attack_slider.
     */
    private JSlider attackMovementModSlider;
    /**
     * Field accuracy_slider.
     */
    private JSlider attackAccuracySlider;
    /**
     * Field additional_mods_slider.
     */
    private JSlider attackAdditionalModSlider;
    /**
     * Field lblWeaponDm.
     */
    private JLabel attackLblWeaponDm;
    /**
     * Field lblMovementAttackModifier.
     */
    private JLabel attackMovementModLbl;
    /**
     * Field lblAccuracyOfThe.
     */
    private JLabel lblAccuracyOfThe;
    /**
     * Field lblAdditionalModifier.
     */
    private JLabel attackAdditionalModLbl;
    /**
     * Field dm_value_textField.
     */
    private JTextField dm_value_textField;
    /**
     * Field attack_panel.
     */
    private JPanel attack_panel;
    /**
     * Field accuracy_attack_mod_textField.
     */
    private JTextField attackAccuracyModTextField;
    /**
     * Field additional_attack_mod_textField.
     */
    private JTextField attackAdditionalModTextField;
    /**
     * Field movement_attack_mod_textField_1.
     */
    private JTextField attackMovementModTextField;
    /**
     * Field defence_selection_list.
     */
    private JList defence_selection_list;
    /**
     * Field defence_selected_list.
     */
    private JList defence_selected_list;
    /**
     * Field armor_slider.
     */
    private JSlider armor_slider;
    /**
     * Field result_panel.
     */
    private JPanel result_panel;
    /**
     * Field range_modifiers.
     */
    private JComboBox attackRangeMods;
    /**
     * Field cover_modifiers.
     */
    private JComboBox attackCoverMods;

    /**
     * Field dice_comboBox.
     */
    private JComboBox dice_comboBox;

    /**
     * Time when the list for the available defense modifiers was clicked the
     * last time.
     */
    private long lastSelectionClicked;
    /**
     * Time when the list for the selected defense modifiers was clicked the
     * last time.
     */
    private long lastSelectedClicked;
    private JTextArea result_textArea;
    private JCheckBox attackSkillChkBox;
    private JTextField attackSkillTextField;
    private JSlider attackSkillThresholdSlider;
    private JLabel attackSkillLbl;
    private JTextField attackThresholdTextField;
    private JCheckBox attackThresholdChkBox;
    private JLabel lblAttackCoverMod;

    private JLabel lblAttackRangeMod;
    private JLabel attackThresholdLbl;
    private JTextField defenceArmorTextField;
    private JTextField defenseMovementModTextfield;
    private JTextField defenseAdditionalModTextField;
    private JTextField defenseThresholdTextField;
    private JLabel defenceThresholdLbl;
    private JTextField defenceSkillTextField;
    private JCheckBox defenseSkillChkBox;
    private JCheckBox defenseThresholdChkBox;
    private JLabel defenseSkillLbl;
    private JLabel defenseMovementModLbl;
    private JSlider defenseMovementModSlider;
    private JLabel defenseAdditionalModLbl;
    private JSlider defenseAdditionalModSlider;
    private JLabel lblSelectedDefenceModifiers;
    private JLabel lblAvailableDefenceModifiers;
    private JSlider defenceSkillThresholdSlider;
    private JButton add_to_selected_listButton;
    private JButton remove_from_selected_list_button;
    private JPanel chart_panel;
    private SimpleBarChart chart;
    private JCheckBox chckbxAp;
    private JCheckBox chckbxWeakFacing;

    /**
     * Create the application.
     */
    public ProbabilityCalculator() {
	initialize();
    }

    /**
     * Method createParamters.
     * 
     * @return ProbabilityParameters
     */
    private ProbabilityParameters createParamters() {
	Dice diceType = Dice.values()[getDiceType().getSelectedIndex()];

	// Attack variables
	int attackMovementMod = getAttackMovementModSlider().getValue();
	int accuracyMod = getAccuracySlider().getValue();
	int attackAdditionalMod = getAttackAdditionalModSlider().getValue();
	int dmValue = getAttackDmSlider().getValue();
	RangeModificator range = RangeModificator.values()[getRange_modifiers()
		.getSelectedIndex()];
	CoverModificator cover = CoverModificator.values()[getCover_modifiers()
		.getSelectedIndex()];
	int attackValue = getAttack_slider().getValue();

	// Defense Variables
	int armor = getArmor_slider().getValue();
	int defenceMovementMod = getDefenseMovementModSlider().getValue();
	int defenceAdditionalMod = getDefenseAdditionalModSlider().getValue();
	int defenseValue = getDefenseSkillThresholdSlider().getValue();

	ProbabilityParameterBuilder parameterBuilder = ProbabilityParameterBuilder
		.getBuilder();
	parameterBuilder.setDiceType(diceType);
	parameterBuilder.setNumberOfAttackDices(attackValue);
	parameterBuilder.setNumberOfDefenseDices(defenseValue);
	parameterBuilder.setAttackThreshold(getAttackThresholdChkBox()
		.isSelected());
	parameterBuilder.setDefenseThreshold(getDefenseThresholdChkBox()
		.isSelected());

	parameterBuilder.setDamageMultiplicator(dmValue);
	parameterBuilder.setTargetArmor(armor);
	parameterBuilder.setAP(getChckbxAp().isSelected());
	parameterBuilder.setWeakFacing(getChckbxWeakFacing().isSelected());
	
	parameterBuilder.applyAttackModificator(ModifierFactory
		.createModificator(attackMovementMod, "Movement: "
			+ attackMovementMod));
	parameterBuilder.applyAttackModificator(ModifierFactory
		.createModificator(accuracyMod, "Accuracy: " + accuracyMod));
	parameterBuilder.applyAttackModificator(ModifierFactory
		.createModificator(attackAdditionalMod,
			"Additional Modifiers: " + attackAdditionalMod));
	parameterBuilder.applyAttackModificator(ModifierFactory
		.createModificator(range.getModificator(), range.toString()));
	parameterBuilder.applyAttackModificator(ModifierFactory
		.createModificator(cover.getModificator(), cover.toString()));
	parameterBuilder.applyDefenseModificator(ModifierFactory
		.createModificator(defenceMovementMod, "Movement: "
			+ defenceMovementMod));
	parameterBuilder.applyDefenseModificator(ModifierFactory
		.createModificator(defenceAdditionalMod,
			"Additional Modifiers: " + defenceAdditionalMod));

	DefaultListModel model = (DefaultListModel) getDefenceSelected_list()
		.getModel();
	for (int i = 0; i < model.getSize(); i++) {
	    DefenseModifiers.CircumstanceModificator circumstanceMod = (CircumstanceModificator) model
		    .get(i);
	    parameterBuilder.applyDefenseModificator(ModifierFactory
		    .createModificator(circumstanceMod.getModificator(),
			    circumstanceMod.toString()));
	}

	return parameterBuilder.build();
    }

    /**
     * Ends the program properly.
     */
    protected void exitProgram() {
	this.frame.dispose();
	System.exit(0);
    }

    /**
     * Method getAccuracy_attack_mod_textField.
     * 
     * @return JTextField
     */
    protected JTextField getAccuracy_attack_mod_textField() {
	return this.attackAccuracyModTextField;
    }

    /**
     * Method getAccuracy_slider.
     * 
     * @return JSlider
     */
    protected JSlider getAccuracySlider() {
	return this.attackAccuracySlider;
    }

    /**
     * Method getArmor_slider.
     * 
     * @return JSlider
     */
    protected JSlider getArmor_slider() {
	return this.armor_slider;
    }

    /**
     * Method getAttack_panel.
     * 
     * @return JPanel
     */
    protected JPanel getAttack_panel() {
	return this.attack_panel;
    }

    protected JSlider getAttack_slider() {
	return this.attackSkillThresholdSlider;
    }

    /**
     * Method getLblAccuracyOfThe.
     * 
     * @return JLabel
     */
    protected JLabel getAttackAccuracyOfTheWeaponLbl() {
	return this.lblAccuracyOfThe;
    }

    protected JSlider getAttackAccuracySlider() {
	return this.attackAccuracySlider;
    }

    protected JLabel getAttackAdditionalModLbl() {
	return this.attackAdditionalModLbl;
    }

    /**
     * Method getAdditional_mods_slider.
     * 
     * @return JSlider
     */
    protected JSlider getAttackAdditionalModSlider() {
	return this.attackAdditionalModSlider;
    }

    /**
     * Method getAdditional_attack_mod_textField.
     * 
     * @return JTextField
     */
    protected JTextField getAttackAdditionalModTextField() {
	return this.attackAdditionalModTextField;
    }

    protected JLabel getAttackCoverModLbl() {
	return this.lblAttackCoverMod;
    }

    protected JComboBox getAttackCoverMods() {
	return this.attackCoverMods;
    }

    /**
     * Method getDm_slider.
     * 
     * @return JSlider
     */
    protected JSlider getAttackDmSlider() {
	return this.attackDmSlider;
    }

    /**
     * Method getLblWeaponDm.
     * 
     * @return JLabel
     */
    protected JLabel getAttackLblWeaponDm() {
	return this.attackLblWeaponDm;
    }

    /**
     * Method getLblMovementAttackModifier.
     * 
     * @return JLabel
     */
    protected JLabel getAttackMovementModLbl() {
	return this.attackMovementModLbl;
    }

    /**
     * Method getMovement_attack_slider.
     * 
     * @return JSlider
     */
    protected JSlider getAttackMovementModSlider() {
	return this.attackMovementModSlider;
    }

    protected JTextField getAttackMovementModTextField() {
	return this.attackMovementModTextField;
    }

    protected JLabel getAttackRangeModLbl() {
	return this.lblAttackRangeMod;
    }

    protected JComboBox getAttackRangeMods() {
	return this.attackRangeMods;
    }

    protected JCheckBox getAttackSkillChkBox() {
	return this.attackSkillChkBox;
    }

    protected JTextField getAttackSkillTextField() {
	return this.attackSkillTextField;
    }

    protected JCheckBox getAttackThresholdChkBox() {
	return this.attackThresholdChkBox;
    }

    protected JTextField getAttackThresholdTextField() {
	return this.attackThresholdTextField;
    }

    /**
     * Method getCover_modifiers.
     * 
     * @return JComboBox
     */
    protected JComboBox getCover_modifiers() {
	return this.attackCoverMods;
    }

    /**
     * Method getDefenceSelected_list.
     * 
     * @return JList
     */
    protected JList getDefenceSelected_list() {
	return this.defence_selected_list;
    }

    /**
     * Method getDefenceSelection_list.
     * 
     * @return JList
     */
    protected JList getDefenceSelection_list() {
	return this.defence_selection_list;
    }

    /**
     * Method getDiceType.
     * 
     * @return JComboBox
     */
    protected JComboBox getDiceType() {
	return this.dice_comboBox;
    }

    /**
     * Method getDm_value_textField.
     * 
     * @return JTextField
     */
    protected JTextField getDm_value_textField() {
	return this.dm_value_textField;
    }

    /**
     * @return the lastSelectedClicked
     */
    protected long getLastSelectedClicked() {
	return this.lastSelectedClicked;
    }

    /**
     * @return the lastSelectionClicked
     */
    protected long getLastSelectionClicked() {
	return this.lastSelectionClicked;
    }

    /**
     * Method getLblAdditionalModifier.
     * 
     * @return JLabel
     */
    protected JLabel getLblAdditionalModifier() {
	return this.attackAdditionalModLbl;
    }

    /**
     * Method getMovement_attack_mod_textField.
     * 
     * @return JTextField
     */
    protected JTextField getMovement_attack_mod_textField() {
	return this.attackMovementModTextField;
    }

    protected JTextField getMovement_attack_mod_textField_1() {
	return this.attackMovementModTextField;
    }

    /**
     * Method getRange_modifiers.
     * 
     * @return JComboBox
     */
    protected JComboBox getRange_modifiers() {
	return this.attackRangeMods;
    }

    /**
     * Method getResult_textArea.
     * 
     * @return JTextArea
     */
    protected JTextArea getResult_textArea() {
	return this.result_textArea;
    }

    protected JTextField getTextFieldAttackThreshold() {
	return this.attackThresholdTextField;
    }

    /**
     * Initialize the contents of the frame.
     */
    private void initialize() {
	this.frame = new JFrame();
	this.frame.setBounds(100, 100, 1197, 720);
	this.frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

	this.attack_panel = new JPanel();
	this.attack_panel.setBorder(new LineBorder(new Color(0, 0, 0)));

	JPanel defense_panel = new JPanel();
	defense_panel.setBorder(new LineBorder(new Color(0, 0, 0)));

	JPanel additional_informtion_panel = new JPanel();
	additional_informtion_panel
		.setBorder(new LineBorder(new Color(0, 0, 0)));

	this.result_panel = new JPanel();
	this.result_panel.setBorder(new LineBorder(new Color(0, 0, 0)));
	
	JPanel button_panel = new JPanel();
	JScrollPane scrollPane = new JScrollPane();
	
	GroupLayout gl_result_panel = initResultPanel(button_panel, scrollPane);
	
	GroupLayout groupLayout = new GroupLayout(this.frame.getContentPane());
	groupLayout
		.setHorizontalGroup(groupLayout
			.createParallelGroup(Alignment.LEADING)
			.addGroup(
				groupLayout
					.createSequentialGroup()
					.addContainerGap()
					.addGroup(
						groupLayout
							.createParallelGroup(
								Alignment.LEADING)
							.addComponent(
								this.result_panel,
								GroupLayout.PREFERRED_SIZE,
								1166,
								GroupLayout.PREFERRED_SIZE)
							.addGroup(
								groupLayout
									.createSequentialGroup()
									.addComponent(
										this.attack_panel,
										GroupLayout.PREFERRED_SIZE,
										461,
										Short.MAX_VALUE)
									.addPreferredGap(
										ComponentPlacement.RELATED)
									.addComponent(
										defense_panel,
										GroupLayout.PREFERRED_SIZE,
										519,
										GroupLayout.PREFERRED_SIZE)
									.addPreferredGap(
										ComponentPlacement.RELATED)
									.addComponent(
										additional_informtion_panel,
										GroupLayout.PREFERRED_SIZE,
										164,
										GroupLayout.PREFERRED_SIZE)))
					.addContainerGap()));
	groupLayout.setVerticalGroup(groupLayout.createParallelGroup(
		Alignment.LEADING).addGroup(
		groupLayout
			.createSequentialGroup()
			.addGroup(
				groupLayout
					.createParallelGroup(Alignment.LEADING)
					.addComponent(
						additional_informtion_panel,
						GroupLayout.DEFAULT_SIZE, 448,
						Short.MAX_VALUE)
					.addComponent(defense_panel, 0, 0,
						Short.MAX_VALUE)
					.addComponent(this.attack_panel,
						GroupLayout.DEFAULT_SIZE, 448,
						Short.MAX_VALUE))
			.addGap(9)
			.addComponent(this.result_panel,
				GroupLayout.PREFERRED_SIZE, 204,
				GroupLayout.PREFERRED_SIZE)));

	this.frame.getContentPane().setLayout(groupLayout);
	
	
	JButton start_calculation = new JButton("Damage Probability"); //$NON-NLS-1$
	start_calculation.setFont(new Font("Tahoma", Font.PLAIN, 10));
	start_calculation.addActionListener(new ActionListener() {
	    @Override
	    public void actionPerformed(ActionEvent e) {
		startDamageBoxProbabilityCalculation();
	    }
	});
	start_calculation
		.setToolTipText("Begins the calculation of the probabilites for the damage boxes.");

	JButton start_MosCalculation = new JButton("MoS \r\n Probability");
	start_MosCalculation.setFont(new Font("Tahoma", Font.PLAIN, 10));
	start_MosCalculation.addActionListener(new ActionListener() {
	    @Override
	    public void actionPerformed(ActionEvent e) {
		startMoSProbabilityCalculation();
	    }
	});
	start_MosCalculation
		.setToolTipText("Starts the calculation for the probabilites for the possible MoS."); //$NON-NLS-1$
	GroupLayout gl_button_panel = new GroupLayout(button_panel);
	gl_button_panel
		.setHorizontalGroup(gl_button_panel
			.createParallelGroup(Alignment.LEADING)
			.addGroup(
				gl_button_panel
					.createSequentialGroup()
					.addContainerGap()
					.addGroup(
						gl_button_panel
							.createParallelGroup(
								Alignment.LEADING)
							.addComponent(
								start_MosCalculation,
								GroupLayout.PREFERRED_SIZE,
								126,
								GroupLayout.PREFERRED_SIZE)
							.addComponent(
								start_calculation,
								GroupLayout.PREFERRED_SIZE,
								126,
								Short.MAX_VALUE))
					.addContainerGap()));
	gl_button_panel.setVerticalGroup(gl_button_panel.createParallelGroup(
		Alignment.LEADING).addGroup(
		gl_button_panel.createSequentialGroup()
			.addComponent(start_MosCalculation)
			.addPreferredGap(ComponentPlacement.RELATED)
			.addComponent(start_calculation)
			.addContainerGap(147, Short.MAX_VALUE)));
	button_panel.setLayout(gl_button_panel);
	
	this.result_panel.setLayout(gl_result_panel);

	this.dm_value_textField = new JTextField();
	this.dm_value_textField.setToolTipText("Shows the DM of the weapon."); //$NON-NLS-1$
	this.dm_value_textField.setText("x10"); //$NON-NLS-1$
	this.dm_value_textField.setEditable(false);
	this.dm_value_textField.setColumns(10);

	this.attackAccuracyModTextField = new JTextField();
	this.attackAccuracyModTextField
		.setToolTipText("Shows the accuracy of the weapon."); //$NON-NLS-1$
	this.attackAccuracyModTextField.setText("0"); //$NON-NLS-1$
	this.attackAccuracyModTextField.setEditable(false);
	this.attackAccuracyModTextField.setColumns(10);

	this.attackAdditionalModTextField = new JTextField();
	this.attackAdditionalModTextField.setEditable(false);
	this.attackAdditionalModTextField
		.setToolTipText("Shows additional modifiers."); //$NON-NLS-1$
	this.attackAdditionalModTextField.setText("0");
	this.attackAdditionalModTextField.setColumns(10);

	JLabel lblDiceType = new JLabel("Dice Type: "); //$NON-NLS-1$
	lblDiceType.setFont(new Font("Arial", Font.BOLD, 13)); //$NON-NLS-1$

	this.dice_comboBox = SpecialJComboBoxFactory
		.createJComboBoxForDiceInformation(Dice.class);
	this.dice_comboBox.setToolTipText("Define the use dice type."); //$NON-NLS-1$

	JLabel lblAdditionalInformation = new JLabel("Extra Information"); //$NON-NLS-1$
	lblAdditionalInformation.setFont(new Font("Aharoni", Font.BOLD //$NON-NLS-1$
		| Font.ITALIC, 15));
	GroupLayout gl_additional_informtion_panel = new GroupLayout(
		additional_informtion_panel);
	gl_additional_informtion_panel
		.setHorizontalGroup(gl_additional_informtion_panel
			.createParallelGroup(Alignment.LEADING)
			.addGroup(
				gl_additional_informtion_panel
					.createSequentialGroup()
					.addContainerGap()
					.addGroup(
						gl_additional_informtion_panel
							.createParallelGroup(
								Alignment.LEADING)
							.addGroup(
								gl_additional_informtion_panel
									.createSequentialGroup()
									.addComponent(
										lblDiceType)
									.addPreferredGap(
										ComponentPlacement.RELATED)
									.addComponent(
										this.dice_comboBox,
										GroupLayout.PREFERRED_SIZE,
										GroupLayout.DEFAULT_SIZE,
										GroupLayout.PREFERRED_SIZE))
							.addComponent(
								lblAdditionalInformation))
					.addContainerGap(33, Short.MAX_VALUE)));
	gl_additional_informtion_panel
		.setVerticalGroup(gl_additional_informtion_panel
			.createParallelGroup(Alignment.LEADING)
			.addGroup(
				gl_additional_informtion_panel
					.createSequentialGroup()
					.addComponent(lblAdditionalInformation,
						GroupLayout.PREFERRED_SIZE, 21,
						GroupLayout.PREFERRED_SIZE)
					.addGap(11)
					.addGroup(
						gl_additional_informtion_panel
							.createParallelGroup(
								Alignment.BASELINE)
							.addComponent(
								lblDiceType)
							.addComponent(
								this.dice_comboBox,
								GroupLayout.PREFERRED_SIZE,
								GroupLayout.DEFAULT_SIZE,
								GroupLayout.PREFERRED_SIZE))
					.addContainerGap(394, Short.MAX_VALUE)));
	additional_informtion_panel.setLayout(gl_additional_informtion_panel);

	JLabel lblDefenseModificators = new JLabel("Defender Variables"); //$NON-NLS-1$
	lblDefenseModificators.setFont(new Font("Trebuchet MS", Font.BOLD //$NON-NLS-1$
		| Font.ITALIC, 15));

	JScrollPane selection_scrollPane = new JScrollPane();

	JScrollPane selected_scrollPane = new JScrollPane();

	this.add_to_selected_listButton = new JButton(">>"); //$NON-NLS-1$
	this.add_to_selected_listButton
		.setToolTipText("Adds selected modifier."); //$NON-NLS-1$
	this.add_to_selected_listButton.addActionListener(new ActionListener() {
	    @Override
	    public void actionPerformed(ActionEvent e) {
		moveFromSelectionListToSelectedList();
	    }
	});

	this.remove_from_selected_list_button = new JButton("<<"); //$NON-NLS-1$
	this.remove_from_selected_list_button
		.setToolTipText("Removes the selected modifer."); //$NON-NLS-1$
	this.remove_from_selected_list_button
		.addActionListener(new ActionListener() {
		    @Override
		    public void actionPerformed(ActionEvent e) {
			moveFromSelectedListToSelectionList();
		    }
		});

	this.defenceArmorTextField = new JTextField();
	this.defenceArmorTextField.setToolTipText("Shows the selected Armor.");
	this.defenceArmorTextField.setText("10");
	this.defenceArmorTextField.setEditable(false);
	this.defenceArmorTextField.setColumns(10);

	this.armor_slider = new JSlider();
	this.armor_slider.addChangeListener(new ChangeListener() {
	    @Override
	    public void stateChanged(ChangeEvent e) {
		getDefenceArmorTextField().setText(
			"" + getArmor_slider().getValue()); //$NON-NLS-1$
	    }
	});

	this.armor_slider
		.setToolTipText("Move the slider to specify the armor of the target."); //$NON-NLS-1$
	this.armor_slider.setValue(10);
	this.armor_slider.setSnapToTicks(true);
	this.armor_slider.setPaintTicks(true);
	this.armor_slider.setPaintLabels(true);
	this.armor_slider.setMinorTickSpacing(1);
	this.armor_slider.setMajorTickSpacing(10);
	this.armor_slider.setOrientation(SwingConstants.VERTICAL);
	this.armor_slider.setMinimum(1);
	this.armor_slider.setMaximum(120);

	final JLabel label = new JLabel("Armor:");
	label.setFont(new Font("Arial", Font.BOLD, 13));

	this.defenseMovementModTextfield = new JTextField();
	this.defenseMovementModTextfield
		.setToolTipText("Shows the defense modificator for the speedband.");
	this.defenseMovementModTextfield.setText("0");
	this.defenseMovementModTextfield.setEditable(false);
	this.defenseMovementModTextfield.setColumns(10);

	this.defenseMovementModLbl = new JLabel("Movement Defense Modifier:");
	this.defenseMovementModLbl.setFont(new Font("Arial", Font.BOLD, 13));

	this.defenseMovementModSlider = new JSlider();
	this.defenseMovementModSlider.addChangeListener(new ChangeListener() {
	    @Override
	    public void stateChanged(ChangeEvent e) {
		String value = "" + getDefenseMovementModSlider().getValue();
		getDefenseMovementModTextfield().setText(value);
	    }
	});
	this.defenseMovementModSlider.setValue(0);
	this.defenseMovementModSlider
		.setToolTipText("Move the sliderto define the defence modifier for the speed band.");
	this.defenseMovementModSlider.setSnapToTicks(true);
	this.defenseMovementModSlider.setPaintTicks(true);
	this.defenseMovementModSlider.setPaintLabels(true);
	this.defenseMovementModSlider.setMinorTickSpacing(1);
	this.defenseMovementModSlider.setMinimum(-5);
	this.defenseMovementModSlider.setMaximum(5);
	this.defenseMovementModSlider.setMajorTickSpacing(1);

	this.defenseAdditionalModLbl = new JLabel("Additional Modifier:");
	this.defenseAdditionalModLbl.setFont(new Font("Arial", Font.BOLD, 13));

	this.defenseAdditionalModTextField = new JTextField();
	this.defenseAdditionalModTextField
		.setToolTipText("Shows additional defence modificators.");
	this.defenseAdditionalModTextField.setText("0");
	this.defenseAdditionalModTextField.setEditable(false);
	this.defenseAdditionalModTextField.setColumns(10);

	this.defenseAdditionalModSlider = new JSlider();
	this.defenseAdditionalModSlider.addChangeListener(new ChangeListener() {
	    @Override
	    public void stateChanged(ChangeEvent e) {
		String value = "" + getDefenseAdditionalModSlider().getValue();
		getDefenseAdditionalModTextField().setText(value);
	    }
	});
	this.defenseAdditionalModSlider.setValue(0);
	this.defenseAdditionalModSlider
		.setToolTipText("Move the slider to specify additional defence modifier.");
	this.defenseAdditionalModSlider.setSnapToTicks(true);
	this.defenseAdditionalModSlider.setPaintTicks(true);
	this.defenseAdditionalModSlider.setPaintLabels(true);
	this.defenseAdditionalModSlider.setMinorTickSpacing(1);
	this.defenseAdditionalModSlider.setMinimum(-5);
	this.defenseAdditionalModSlider.setMaximum(5);
	this.defenseAdditionalModSlider.setMajorTickSpacing(1);

	this.defenseThresholdTextField = new JTextField();
	this.defenseThresholdTextField.setEnabled(false);
	this.defenseThresholdTextField
		.setToolTipText("Shows the used dices for the defence roll.");
	this.defenseThresholdTextField.setText("2");
	this.defenseThresholdTextField.setEditable(false);
	this.defenseThresholdTextField.setColumns(10);

	this.defenceSkillTextField = new JTextField();
	this.defenceSkillTextField
		.setToolTipText("Shows the used dices for the defence roll.");
	this.defenceSkillTextField.setText("2");
	this.defenceSkillTextField.setEditable(false);
	this.defenceSkillTextField.setColumns(10);

	this.defenseSkillLbl = new JLabel("Defense Skill:");
	this.defenseSkillLbl
		.setToolTipText("Sets the number of defence dices the defender posses.");
	this.defenseSkillLbl.setFont(new Font("Arial", Font.BOLD, 13));

	this.defenceSkillThresholdSlider = new JSlider();
	this.defenceSkillThresholdSlider
		.addChangeListener(new ChangeListener() {
		    @Override
		    public void stateChanged(ChangeEvent e) {
			String value = ""
				+ getDefenseSkillThresholdSlider().getValue();
			getDefenseSkillTextField().setText(value);
			getDefenseThresholdTextField().setText(value);
		    }
		});
	this.defenceSkillThresholdSlider.setValue(2);
	this.defenceSkillThresholdSlider
		.setToolTipText("Move the slider to determine the number of defence dices.");
	this.defenceSkillThresholdSlider.setSnapToTicks(true);
	this.defenceSkillThresholdSlider.setPaintTicks(true);
	this.defenceSkillThresholdSlider.setPaintLabels(true);
	this.defenceSkillThresholdSlider.setMinorTickSpacing(1);
	this.defenceSkillThresholdSlider.setMinimum(1);
	this.defenceSkillThresholdSlider.setMaximum(8);
	this.defenceSkillThresholdSlider.setMajorTickSpacing(1);

	this.defenceThresholdLbl = new JLabel("Defense Threshold:");
	this.defenceThresholdLbl.setEnabled(false);
	this.defenceThresholdLbl.setFont(new Font("Arial", Font.BOLD, 13));

	this.defenseSkillChkBox = new JCheckBox("Using Skill");
	this.defenseSkillChkBox.setSelected(true);
	this.defenseSkillChkBox.addChangeListener(new ChangeListener() {
	    @Override
	    public void stateChanged(ChangeEvent e) {
		boolean selected = getDefenseSkillChkBox().isSelected();
		if (selected) {
		    switchToDefenseSkill();
		} else {
		    switchToDefenseThreshold();
		}
	    }
	});

	this.defenseThresholdChkBox = new JCheckBox("Using Threshold");
	this.defenseThresholdChkBox.addChangeListener(new ChangeListener() {
	    @Override
	    public void stateChanged(ChangeEvent e) {
		boolean selected = getDefenseThresholdChkBox().isSelected();
		if (selected) {
		    switchToDefenseThreshold();
		} else {
		    switchToDefenseSkill();
		}
	    }
	});
	this.defenseThresholdChkBox.setToolTipText("");
	
	this.chckbxWeakFacing = new JCheckBox("Weak Facing");

	GroupLayout gl_defense_panel = new GroupLayout(defense_panel);
	gl_defense_panel.setHorizontalGroup(
		gl_defense_panel.createParallelGroup(Alignment.LEADING)
			.addGroup(gl_defense_panel.createSequentialGroup()
				.addGroup(gl_defense_panel.createParallelGroup(Alignment.LEADING)
					.addGroup(gl_defense_panel.createSequentialGroup()
						.addGap(159)
						.addComponent(lblDefenseModificators))
					.addGroup(gl_defense_panel.createSequentialGroup()
						.addContainerGap()
						.addGroup(gl_defense_panel.createParallelGroup(Alignment.LEADING)
							.addComponent(this.defenceSkillThresholdSlider, GroupLayout.PREFERRED_SIZE, 316, GroupLayout.PREFERRED_SIZE)
							.addGroup(gl_defense_panel.createSequentialGroup()
								.addComponent(this.defenseMovementModLbl, GroupLayout.PREFERRED_SIZE, 181, GroupLayout.PREFERRED_SIZE)
								.addGap(6)
								.addComponent(this.defenseMovementModTextfield, GroupLayout.PREFERRED_SIZE, 86, GroupLayout.PREFERRED_SIZE))
							.addComponent(this.defenseMovementModSlider, GroupLayout.PREFERRED_SIZE, 316, GroupLayout.PREFERRED_SIZE)
							.addGroup(gl_defense_panel.createSequentialGroup()
								.addComponent(this.defenseAdditionalModLbl, GroupLayout.PREFERRED_SIZE, 132, GroupLayout.PREFERRED_SIZE)
								.addGap(58)
								.addComponent(this.defenseAdditionalModTextField, GroupLayout.PREFERRED_SIZE, 86, GroupLayout.PREFERRED_SIZE))
							.addGroup(gl_defense_panel.createSequentialGroup()
								.addComponent(this.defenseAdditionalModSlider, GroupLayout.PREFERRED_SIZE, 316, GroupLayout.PREFERRED_SIZE)
								.addPreferredGap(ComponentPlacement.RELATED)
								.addComponent(this.chckbxWeakFacing))
							.addGroup(gl_defense_panel.createSequentialGroup()
								.addComponent(selection_scrollPane, GroupLayout.PREFERRED_SIZE, 181, GroupLayout.PREFERRED_SIZE)
								.addPreferredGap(ComponentPlacement.UNRELATED)
								.addGroup(gl_defense_panel.createParallelGroup(Alignment.TRAILING, false)
									.addComponent(this.add_to_selected_listButton, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
									.addComponent(this.remove_from_selected_list_button, GroupLayout.DEFAULT_SIZE, 58, Short.MAX_VALUE))
								.addPreferredGap(ComponentPlacement.RELATED)
								.addComponent(selected_scrollPane, GroupLayout.PREFERRED_SIZE, 169, GroupLayout.PREFERRED_SIZE))
							.addGroup(gl_defense_panel.createSequentialGroup()
								.addComponent(this.defenceThresholdLbl)
								.addPreferredGap(ComponentPlacement.RELATED)
								.addGroup(gl_defense_panel.createParallelGroup(Alignment.LEADING)
									.addGroup(gl_defense_panel.createSequentialGroup()
										.addComponent(this.defenceSkillTextField, GroupLayout.PREFERRED_SIZE, 86, GroupLayout.PREFERRED_SIZE)
										.addPreferredGap(ComponentPlacement.UNRELATED)
										.addComponent(this.defenseSkillChkBox)
										.addGap(18)
										.addComponent(label, GroupLayout.PREFERRED_SIZE, 43, GroupLayout.PREFERRED_SIZE)
										.addGap(4)
										.addComponent(this.defenceArmorTextField, GroupLayout.PREFERRED_SIZE, 66, GroupLayout.PREFERRED_SIZE))
									.addGroup(gl_defense_panel.createSequentialGroup()
										.addComponent(this.defenseThresholdTextField, GroupLayout.PREFERRED_SIZE, 86, GroupLayout.PREFERRED_SIZE)
										.addPreferredGap(ComponentPlacement.UNRELATED)
										.addComponent(this.defenseThresholdChkBox))))
							.addComponent(this.defenseSkillLbl, GroupLayout.PREFERRED_SIZE, 87, GroupLayout.PREFERRED_SIZE))
						.addPreferredGap(ComponentPlacement.RELATED)
						.addComponent(this.armor_slider, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
				.addGap(12))
	);
	gl_defense_panel.setVerticalGroup(
		gl_defense_panel.createParallelGroup(Alignment.TRAILING)
			.addGroup(gl_defense_panel.createSequentialGroup()
				.addGroup(gl_defense_panel.createParallelGroup(Alignment.LEADING)
					.addComponent(lblDefenseModificators)
					.addGroup(gl_defense_panel.createSequentialGroup()
						.addGap(28)
						.addGroup(gl_defense_panel.createParallelGroup(Alignment.TRAILING)
							.addGroup(gl_defense_panel.createParallelGroup(Alignment.BASELINE)
								.addComponent(this.defenseSkillLbl, GroupLayout.PREFERRED_SIZE, 15, GroupLayout.PREFERRED_SIZE)
								.addComponent(this.defenceSkillTextField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
								.addComponent(this.defenseSkillChkBox))
							.addGroup(gl_defense_panel.createParallelGroup(Alignment.LEADING)
								.addGroup(gl_defense_panel.createSequentialGroup()
									.addGap(2)
									.addComponent(label, GroupLayout.PREFERRED_SIZE, 15, GroupLayout.PREFERRED_SIZE))
								.addComponent(this.defenceArmorTextField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
						.addGap(9)
						.addGroup(gl_defense_panel.createParallelGroup(Alignment.BASELINE)
							.addComponent(this.defenseThresholdTextField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
							.addComponent(this.defenceThresholdLbl)
							.addComponent(this.defenseThresholdChkBox))))
				.addPreferredGap(ComponentPlacement.RELATED)
				.addComponent(this.defenceSkillThresholdSlider, GroupLayout.PREFERRED_SIZE, 45, GroupLayout.PREFERRED_SIZE)
				.addPreferredGap(ComponentPlacement.RELATED)
				.addGroup(gl_defense_panel.createParallelGroup(Alignment.LEADING)
					.addGroup(gl_defense_panel.createSequentialGroup()
						.addGap(2)
						.addComponent(this.defenseMovementModLbl, GroupLayout.PREFERRED_SIZE, 15, GroupLayout.PREFERRED_SIZE))
					.addComponent(this.defenseMovementModTextfield, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
				.addGap(11)
				.addComponent(this.defenseMovementModSlider, GroupLayout.PREFERRED_SIZE, 45, GroupLayout.PREFERRED_SIZE)
				.addPreferredGap(ComponentPlacement.RELATED, 7, Short.MAX_VALUE)
				.addGroup(gl_defense_panel.createParallelGroup(Alignment.BASELINE)
					.addComponent(this.defenseAdditionalModLbl, GroupLayout.PREFERRED_SIZE, 15, GroupLayout.PREFERRED_SIZE)
					.addComponent(this.defenseAdditionalModTextField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
				.addPreferredGap(ComponentPlacement.RELATED)
				.addGroup(gl_defense_panel.createParallelGroup(Alignment.LEADING)
					.addComponent(this.defenseAdditionalModSlider, GroupLayout.PREFERRED_SIZE, 45, GroupLayout.PREFERRED_SIZE)
					.addComponent(this.chckbxWeakFacing))
				.addPreferredGap(ComponentPlacement.RELATED)
				.addGroup(gl_defense_panel.createParallelGroup(Alignment.LEADING)
					.addGroup(gl_defense_panel.createSequentialGroup()
						.addGap(26)
						.addComponent(this.add_to_selected_listButton)
						.addGap(18)
						.addComponent(this.remove_from_selected_list_button))
					.addGroup(gl_defense_panel.createParallelGroup(Alignment.BASELINE)
						.addComponent(selection_scrollPane, GroupLayout.PREFERRED_SIZE, 140, GroupLayout.PREFERRED_SIZE)
						.addComponent(selected_scrollPane, GroupLayout.PREFERRED_SIZE, 140, GroupLayout.PREFERRED_SIZE)))
				.addContainerGap(14, Short.MAX_VALUE))
			.addGroup(gl_defense_panel.createSequentialGroup()
				.addContainerGap(47, Short.MAX_VALUE)
				.addComponent(this.armor_slider, GroupLayout.PREFERRED_SIZE, 395, GroupLayout.PREFERRED_SIZE)
				.addContainerGap())
	);

	this.defence_selected_list = SpecialSelectionListFactory
		.createModifierJList();
	this.defence_selected_list.addMouseListener(new MouseAdapter() {
	    @Override
	    public void mouseClicked(MouseEvent e) {
		long difference = System.currentTimeMillis()
			- getLastSelectedClicked();
		setLastSelectedClicked(System.currentTimeMillis());

		if (difference < DOUBLE_CLICK_TIME) {
		    moveFromSelectedListToSelectionList();
		}
	    }
	});
	selected_scrollPane.setViewportView(this.defence_selected_list);

	this.lblSelectedDefenceModifiers = new JLabel("Selected Modifiers"); //$NON-NLS-1$
	this.lblSelectedDefenceModifiers.setFont(new Font(
		"Arial", Font.BOLD, 13)); //$NON-NLS-1$
	selected_scrollPane
		.setColumnHeaderView(this.lblSelectedDefenceModifiers);

	this.defence_selection_list = SpecialSelectionListFactory
		.createModifierJList(DefenseModifiers.CircumstanceModificator.class);
	this.defence_selection_list.addMouseListener(new MouseAdapter() {
	    @Override
	    public void mouseClicked(MouseEvent e) {
		long difference = System.currentTimeMillis()
			- getLastSelectionClicked();
		setLastSelectionClicked(System.currentTimeMillis());

		if (difference < DOUBLE_CLICK_TIME) {
		    moveFromSelectionListToSelectedList();
		}
	    }
	});
	selection_scrollPane.setViewportView(this.defence_selection_list);

	this.lblAvailableDefenceModifiers = new JLabel("Available Modifiers");
	this.lblAvailableDefenceModifiers.setFont(new Font("Arial", Font.BOLD,
		13));
	selection_scrollPane
		.setColumnHeaderView(this.lblAvailableDefenceModifiers);
	defense_panel.setLayout(gl_defense_panel);

	JLabel lblAttackModificators = new JLabel("Attacker Variables"); //$NON-NLS-1$
	lblAttackModificators.setFont(new Font("Trebuchet MS", Font.BOLD //$NON-NLS-1$
		| Font.ITALIC, 15));

	this.attackRangeMods = SpecialJComboBoxFactory
		.createJComboBoxForModifiers(AttackModifiers.RangeModificator.class);
	this.attackRangeMods
		.setToolTipText("Range modifers. First came the L&L 1.1 modifers and then the GU modifiers."); //$NON-NLS-1$

	this.lblAttackRangeMod = new JLabel("Range: "); //$NON-NLS-1$
	this.lblAttackRangeMod.setFont(new Font("Arial", Font.BOLD, 13)); //$NON-NLS-1$

	this.lblAttackCoverMod = new JLabel("Cover: "); //$NON-NLS-1$
	this.lblAttackCoverMod.setFont(new Font("Arial", Font.BOLD, 13)); //$NON-NLS-1$

	this.attackCoverMods = SpecialJComboBoxFactory
		.createJComboBoxForModifiers(AttackModifiers.CoverModificator.class);
	this.attackCoverMods.setToolTipText("Cover modifers."); //$NON-NLS-1$

	this.attackMovementModTextField = new JTextField();
	this.attackMovementModTextField
		.setToolTipText("Shows the modifier for the movement type and speed"); //$NON-NLS-1$
	this.attackMovementModTextField.setText("0"); //$NON-NLS-1$
	this.attackMovementModTextField.setEditable(false);
	this.attackMovementModTextField.setColumns(10);

	this.attackMovementModSlider = new JSlider();
	this.attackMovementModSlider.addChangeListener(new ChangeListener() {
	    @Override
	    public void stateChanged(ChangeEvent e) {
		getMovement_attack_mod_textField().setText(
			"" + getAttackMovementModSlider().getValue()); //$NON-NLS-1$
	    }
	});

	this.attackMovementModSlider
		.setToolTipText("Move the slider to specify the attack modifier for the movent type and actual speed."); //$NON-NLS-1$
	this.attackMovementModSlider.setSnapToTicks(true);
	this.attackMovementModSlider.setPaintLabels(true);
	this.attackMovementModSlider.setPaintTicks(true);
	this.attackMovementModSlider.setMinorTickSpacing(1);
	this.attackMovementModSlider.setMajorTickSpacing(1);
	this.attackMovementModSlider.setMinimum(-5);
	this.attackMovementModSlider.setMaximum(5);
	this.attackMovementModSlider.setValue(0);

	this.attackMovementModLbl = new JLabel("Movement Attack Modifier: "); //$NON-NLS-1$
	this.attackMovementModLbl.setFont(new Font("Arial", Font.BOLD, 13)); //$NON-NLS-1$

	this.attackAccuracySlider = new JSlider();
	this.attackAccuracySlider.addChangeListener(new ChangeListener() {
	    @Override
	    public void stateChanged(ChangeEvent e) {
		getAccuracy_attack_mod_textField().setText(
			"" + getAccuracySlider().getValue()); //$NON-NLS-1$
	    }
	});
	this.attackAccuracySlider
		.setToolTipText("Move the slider to specify the accuracy of the weapon."); //$NON-NLS-1$
	this.attackAccuracySlider.setSnapToTicks(true);
	this.attackAccuracySlider.setMinorTickSpacing(1);
	this.attackAccuracySlider.setMajorTickSpacing(1);
	this.attackAccuracySlider.setPaintTicks(true);
	this.attackAccuracySlider.setPaintLabels(true);
	this.attackAccuracySlider.setMinimum(-5);
	this.attackAccuracySlider.setMaximum(5);
	this.attackAccuracySlider.setValue(0);

	this.lblAccuracyOfThe = new JLabel("Accuracy of the Weapon:"); //$NON-NLS-1$
	this.lblAccuracyOfThe.setFont(new Font("Arial", Font.BOLD, 13)); //$NON-NLS-1$

	this.attackAdditionalModSlider = new JSlider();
	this.attackAdditionalModSlider.addChangeListener(new ChangeListener() {
	    @Override
	    public void stateChanged(ChangeEvent e) {
		getAttackAdditionalModTextField().setText(
			"" + getAttackAdditionalModSlider().getValue()); //$NON-NLS-1$
	    }
	});
	this.attackAdditionalModSlider
		.setToolTipText("Move the slider to specify additional modifier values for the attack."); //$NON-NLS-1$
	this.attackAdditionalModSlider.setSnapToTicks(true);
	this.attackAdditionalModSlider.setPaintTicks(true);
	this.attackAdditionalModSlider.setPaintLabels(true);
	this.attackAdditionalModSlider.setMinorTickSpacing(1);
	this.attackAdditionalModSlider.setMajorTickSpacing(1);
	this.attackAdditionalModSlider.setMinimum(-5);
	this.attackAdditionalModSlider.setMaximum(5);
	this.attackAdditionalModSlider.setValue(0);

	this.attackSkillTextField = new JTextField();
	this.attackSkillTextField
		.setToolTipText("Shows the used attack dices.");
	this.attackSkillTextField.setText("2");
	this.attackSkillTextField.setEditable(false);
	this.attackSkillTextField.setColumns(10);

	this.attackThresholdTextField = new JTextField();
	this.attackThresholdTextField.setEnabled(false);
	this.attackThresholdTextField
		.setToolTipText("Shows the used attack dices.");
	this.attackThresholdTextField.setText("2");
	this.attackThresholdTextField.setEditable(false);
	this.attackThresholdTextField.setColumns(10);

	this.attackSkillThresholdSlider = new JSlider();
	this.attackSkillThresholdSlider.addChangeListener(new ChangeListener() {
	    @Override
	    public void stateChanged(ChangeEvent e) {
		getAttackSkillTextField().setText(
			"" + getAttackSkillThresholdSlider().getValue());
		getAttackThresholdTextField().setText(
			"" + getAttackSkillThresholdSlider().getValue());
	    }
	});
	this.attackSkillThresholdSlider.setValue(2);
	this.attackSkillThresholdSlider
		.setToolTipText("Move the slider to specify the number of attack dices.");
	this.attackSkillThresholdSlider.setSnapToTicks(true);
	this.attackSkillThresholdSlider.setPaintTicks(true);
	this.attackSkillThresholdSlider.setPaintLabels(true);
	this.attackSkillThresholdSlider.setMinorTickSpacing(1);
	this.attackSkillThresholdSlider.setMinimum(1);
	this.attackSkillThresholdSlider.setMaximum(8);
	this.attackSkillThresholdSlider.setMajorTickSpacing(1);

	this.attackSkillLbl = new JLabel("Attack Skill:");
	this.attackSkillLbl
		.setToolTipText("Move the slider to define the number of attack dices.");
	this.attackSkillLbl.setFont(new Font("Arial", Font.BOLD, 13));

	this.attackThresholdLbl = new JLabel("Threshold");
	this.attackThresholdLbl.setEnabled(false);
	this.attackThresholdLbl.setFont(new Font("Arial", Font.BOLD, 13));

	this.attackThresholdChkBox = new JCheckBox("Using Threshold");
	this.attackThresholdChkBox.addChangeListener(new ChangeListener() {
	    @Override
	    public void stateChanged(ChangeEvent e) {
		boolean selected = getAttackThresholdChkBox().isSelected();
		if (selected) {
		    switchAttackThresholdModsOn();
		} else {
		    switchAttackSkillModsOn();
		}
	    }
	});

	this.attackThresholdChkBox
		.setToolTipText("If selected all defined variables are ignored for the probability calculation and the attack roll gets a static result.");

	this.attackAdditionalModLbl = new JLabel("Additional Modifier:");
	this.attackAdditionalModLbl.setFont(new Font("Arial", Font.BOLD, 13));

	JPanel panel = new JPanel();

	this.attackLblWeaponDm = new JLabel("Weapon DM: ");
	this.attackLblWeaponDm.setFont(new Font("Arial", Font.BOLD, 13));

	this.attackSkillChkBox = new JCheckBox("Using Skill");
	this.attackSkillChkBox.addChangeListener(new ChangeListener() {
	    @Override
	    public void stateChanged(ChangeEvent evt) {
		boolean selected = getAttackSkillChkBox().isSelected();
		if (selected) {
		    switchAttackSkillModsOn();
		} else {
		    switchAttackThresholdModsOn();
		}
	    }

	});
	this.attackSkillChkBox.setSelected(true);
	this.attackSkillChkBox
		.setToolTipText("If selected all defined variables are ignored for the probability calculation and the attack roll gets a static result.");
	
	this.chckbxAp = new JCheckBox("AP");

	GroupLayout gl_attack_panel = new GroupLayout(this.attack_panel);
	gl_attack_panel.setHorizontalGroup(
		gl_attack_panel.createParallelGroup(Alignment.TRAILING)
			.addGroup(gl_attack_panel.createSequentialGroup()
				.addGroup(gl_attack_panel.createParallelGroup(Alignment.LEADING)
					.addGroup(gl_attack_panel.createSequentialGroup()
						.addContainerGap()
						.addGroup(gl_attack_panel.createParallelGroup(Alignment.LEADING)
							.addGroup(gl_attack_panel.createParallelGroup(Alignment.LEADING)
								.addGroup(gl_attack_panel.createParallelGroup(Alignment.LEADING)
									.addGroup(gl_attack_panel.createSequentialGroup()
										.addGroup(gl_attack_panel.createParallelGroup(Alignment.TRAILING)
											.addComponent(this.attackAccuracySlider, GroupLayout.DEFAULT_SIZE, 299, Short.MAX_VALUE)
											.addComponent(this.attackMovementModSlider, GroupLayout.DEFAULT_SIZE, 299, Short.MAX_VALUE)
											.addGroup(gl_attack_panel.createSequentialGroup()
												.addComponent(this.attackMovementModLbl)
												.addPreferredGap(ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
												.addComponent(this.attackMovementModTextField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
											.addGroup(gl_attack_panel.createSequentialGroup()
												.addComponent(this.lblAccuracyOfThe)
												.addPreferredGap(ComponentPlacement.RELATED, 26, Short.MAX_VALUE)
												.addComponent(this.attackAccuracyModTextField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
											.addGroup(gl_attack_panel.createSequentialGroup()
												.addComponent(this.attackAdditionalModLbl)
												.addPreferredGap(ComponentPlacement.RELATED, 60, Short.MAX_VALUE)
												.addComponent(this.attackAdditionalModTextField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
										.addGap(26))
									.addGroup(gl_attack_panel.createSequentialGroup()
										.addComponent(this.attackAdditionalModSlider, GroupLayout.DEFAULT_SIZE, 313, Short.MAX_VALUE)
										.addPreferredGap(ComponentPlacement.RELATED)))
								.addGroup(gl_attack_panel.createSequentialGroup()
									.addGroup(gl_attack_panel.createParallelGroup(Alignment.LEADING)
										.addGroup(gl_attack_panel.createSequentialGroup()
											.addGroup(gl_attack_panel.createParallelGroup(Alignment.LEADING)
												.addComponent(this.attackSkillLbl, GroupLayout.PREFERRED_SIZE, 75, GroupLayout.PREFERRED_SIZE)
												.addComponent(this.attackThresholdLbl))
											.addGap(19)
											.addGroup(gl_attack_panel.createParallelGroup(Alignment.LEADING, false)
												.addGroup(gl_attack_panel.createSequentialGroup()
													.addComponent(this.attackThresholdTextField, GroupLayout.PREFERRED_SIZE, 86, GroupLayout.PREFERRED_SIZE)
													.addPreferredGap(ComponentPlacement.UNRELATED)
													.addComponent(this.attackThresholdChkBox))
												.addGroup(gl_attack_panel.createSequentialGroup()
													.addComponent(this.attackSkillTextField, GroupLayout.PREFERRED_SIZE, 86, GroupLayout.PREFERRED_SIZE)
													.addPreferredGap(ComponentPlacement.UNRELATED)
													.addComponent(this.attackSkillChkBox, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
										.addComponent(this.attackSkillThresholdSlider, GroupLayout.PREFERRED_SIZE, 305, GroupLayout.PREFERRED_SIZE))
									.addPreferredGap(ComponentPlacement.RELATED)))
							.addGroup(gl_attack_panel.createSequentialGroup()
								.addGroup(gl_attack_panel.createParallelGroup(Alignment.LEADING)
									.addComponent(this.lblAttackCoverMod)
									.addComponent(this.lblAttackRangeMod))
								.addPreferredGap(ComponentPlacement.RELATED)
								.addGroup(gl_attack_panel.createParallelGroup(Alignment.TRAILING, false)
									.addComponent(this.attackRangeMods, 0, 0, Short.MAX_VALUE)
									.addComponent(this.attackCoverMods, GroupLayout.PREFERRED_SIZE, 173, GroupLayout.PREFERRED_SIZE))
								.addPreferredGap(ComponentPlacement.RELATED))))
					.addGroup(gl_attack_panel.createSequentialGroup()
						.addGap(151)
						.addComponent(lblAttackModificators)
						.addGap(50)))
				.addGroup(gl_attack_panel.createParallelGroup(Alignment.LEADING)
					.addGroup(gl_attack_panel.createSequentialGroup()
						.addComponent(panel, GroupLayout.PREFERRED_SIZE, 65, GroupLayout.PREFERRED_SIZE)
						.addGap(18)
						.addComponent(this.chckbxAp))
					.addGroup(gl_attack_panel.createSequentialGroup()
						.addComponent(this.attackLblWeaponDm)
						.addGap(4)
						.addComponent(this.dm_value_textField, GroupLayout.PREFERRED_SIZE, 33, GroupLayout.PREFERRED_SIZE)))
				.addContainerGap())
	);
	gl_attack_panel.setVerticalGroup(
		gl_attack_panel.createParallelGroup(Alignment.LEADING)
			.addGroup(gl_attack_panel.createSequentialGroup()
				.addComponent(lblAttackModificators)
				.addGap(25)
				.addGroup(gl_attack_panel.createParallelGroup(Alignment.BASELINE)
					.addComponent(this.attackLblWeaponDm)
					.addComponent(this.dm_value_textField, GroupLayout.PREFERRED_SIZE, 23, GroupLayout.PREFERRED_SIZE))
				.addGap(6)
				.addGroup(gl_attack_panel.createParallelGroup(Alignment.TRAILING)
					.addGroup(gl_attack_panel.createSequentialGroup()
						.addComponent(panel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
						.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
					.addGroup(gl_attack_panel.createSequentialGroup()
						.addComponent(this.chckbxAp)
						.addGap(47)
						.addGroup(gl_attack_panel.createParallelGroup(Alignment.TRAILING, false)
							.addGroup(gl_attack_panel.createSequentialGroup()
								.addComponent(this.lblAttackRangeMod)
								.addPreferredGap(ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
								.addComponent(this.lblAttackCoverMod))
							.addGroup(gl_attack_panel.createParallelGroup(Alignment.LEADING)
								.addComponent(this.attackRangeMods, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
								.addGroup(gl_attack_panel.createSequentialGroup()
									.addGap(31)
									.addComponent(this.attackCoverMods, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))))
						.addPreferredGap(ComponentPlacement.RELATED, 25, Short.MAX_VALUE)
						.addGroup(gl_attack_panel.createParallelGroup(Alignment.BASELINE)
							.addComponent(this.attackMovementModLbl)
							.addComponent(this.attackMovementModTextField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
						.addPreferredGap(ComponentPlacement.RELATED)
						.addComponent(this.attackMovementModSlider, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
						.addPreferredGap(ComponentPlacement.RELATED)
						.addGroup(gl_attack_panel.createParallelGroup(Alignment.BASELINE)
							.addComponent(this.lblAccuracyOfThe)
							.addComponent(this.attackAccuracyModTextField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
						.addGap(11)
						.addComponent(this.attackAccuracySlider, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
						.addPreferredGap(ComponentPlacement.RELATED)
						.addGroup(gl_attack_panel.createParallelGroup(Alignment.TRAILING)
							.addComponent(this.attackAdditionalModTextField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
							.addComponent(this.attackAdditionalModLbl))
						.addPreferredGap(ComponentPlacement.RELATED)
						.addComponent(this.attackAdditionalModSlider, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
						.addGap(17))))
			.addGroup(gl_attack_panel.createSequentialGroup()
				.addGap(30)
				.addGroup(gl_attack_panel.createParallelGroup(Alignment.BASELINE)
					.addComponent(this.attackSkillLbl, GroupLayout.PREFERRED_SIZE, 15, GroupLayout.PREFERRED_SIZE)
					.addComponent(this.attackSkillTextField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
					.addComponent(this.attackSkillChkBox))
				.addPreferredGap(ComponentPlacement.RELATED)
				.addGroup(gl_attack_panel.createParallelGroup(Alignment.BASELINE)
					.addComponent(this.attackThresholdLbl)
					.addComponent(this.attackThresholdTextField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
					.addComponent(this.attackThresholdChkBox))
				.addPreferredGap(ComponentPlacement.UNRELATED)
				.addComponent(this.attackSkillThresholdSlider, GroupLayout.PREFERRED_SIZE, 45, GroupLayout.PREFERRED_SIZE)
				.addContainerGap(331, Short.MAX_VALUE))
	);

	this.attackDmSlider = new JSlider();
	this.attackDmSlider.addChangeListener(new ChangeListener() {
	    @Override
	    public void stateChanged(ChangeEvent e) {
		String text = "x" + getAttackDmSlider().getValue(); //$NON-NLS-1$
		getDm_value_textField().setText(text);
		getAttack_panel().repaint();
	    }
	});

	this.attackDmSlider
		.setToolTipText("Move the slider up and down do define the damage multiplicator of the used weapon."); //$NON-NLS-1$
	this.attackDmSlider.setValue(10);
	this.attackDmSlider.setMinorTickSpacing(1);
	this.attackDmSlider.setMinimum(1);
	this.attackDmSlider.setMajorTickSpacing(5);
	this.attackDmSlider.setMaximum(60);
	this.attackDmSlider.setSnapToTicks(true);
	this.attackDmSlider.setPaintTicks(true);
	this.attackDmSlider.setPaintLabels(true);
	this.attackDmSlider.setOrientation(SwingConstants.VERTICAL);

	GroupLayout gl_panel = new GroupLayout(panel);
	gl_panel.setHorizontalGroup(gl_panel.createParallelGroup(
		Alignment.LEADING).addGroup(
		gl_panel.createSequentialGroup()
			.addContainerGap()
			.addComponent(this.attackDmSlider,
				GroupLayout.PREFERRED_SIZE,
				GroupLayout.DEFAULT_SIZE,
				GroupLayout.PREFERRED_SIZE)
			.addContainerGap(33, Short.MAX_VALUE)));
	gl_panel.setVerticalGroup(gl_panel.createParallelGroup(
		Alignment.LEADING).addGroup(
		gl_panel.createSequentialGroup()
			.addComponent(this.attackDmSlider,
				GroupLayout.PREFERRED_SIZE, 354,
				GroupLayout.PREFERRED_SIZE)
			.addContainerGap(15, Short.MAX_VALUE)));
	panel.setLayout(gl_panel);

	this.attack_panel.setLayout(gl_attack_panel);
	
	initMenue();
    }

    /**
     * @param button_panel
     * @param scrollPane
     * @return
     */
    private GroupLayout initResultPanel(JPanel button_panel,
	    JScrollPane scrollPane) {
	this.chart_panel = new JPanel();
	
	GroupLayout gl_result_panel = new GroupLayout(this.result_panel);
	gl_result_panel.setHorizontalGroup(gl_result_panel.createParallelGroup(
		Alignment.LEADING).addGroup(
		gl_result_panel
			.createSequentialGroup()
			.addComponent(button_panel, GroupLayout.PREFERRED_SIZE,
				GroupLayout.DEFAULT_SIZE,
				GroupLayout.PREFERRED_SIZE)
			.addPreferredGap(ComponentPlacement.RELATED)
			.addComponent(scrollPane, GroupLayout.PREFERRED_SIZE,
				437, GroupLayout.PREFERRED_SIZE)
			.addPreferredGap(ComponentPlacement.RELATED)
			.addComponent(this.chart_panel,
				GroupLayout.PREFERRED_SIZE, 567,
				GroupLayout.PREFERRED_SIZE)
			.addContainerGap(GroupLayout.DEFAULT_SIZE,
				Short.MAX_VALUE)));
	gl_result_panel
		.setVerticalGroup(gl_result_panel
			.createParallelGroup(Alignment.LEADING)
			.addGroup(
				gl_result_panel
					.createSequentialGroup()
					.addGroup(
						gl_result_panel
							.createParallelGroup(
								Alignment.LEADING)
							.addComponent(
								button_panel,
								GroupLayout.PREFERRED_SIZE,
								199,
								GroupLayout.PREFERRED_SIZE)
							.addComponent(
								scrollPane,
								GroupLayout.PREFERRED_SIZE,
								194,
								GroupLayout.PREFERRED_SIZE)
							.addComponent(
								this.chart_panel,
								GroupLayout.PREFERRED_SIZE,
								194,
								GroupLayout.PREFERRED_SIZE))
					.addContainerGap(
						GroupLayout.DEFAULT_SIZE,
						Short.MAX_VALUE)));

	initChartPanel();
	
	this.result_textArea = new JTextArea();
	scrollPane.setViewportView(this.result_textArea);
	return gl_result_panel;
    }

    private void initChartPanel() {
	this.chart = ChartFactory.getBarChart();
	
	GroupLayout gl_chart_panel = new GroupLayout(this.chart_panel);
	gl_chart_panel.setHorizontalGroup(gl_chart_panel.createParallelGroup(
		Alignment.LEADING).addGroup(
		gl_chart_panel
			.createSequentialGroup()
			.addComponent(this.chart, GroupLayout.PREFERRED_SIZE,
				567, GroupLayout.PREFERRED_SIZE)
			.addContainerGap(GroupLayout.DEFAULT_SIZE,
				Short.MAX_VALUE)));

	gl_chart_panel.setVerticalGroup(gl_chart_panel.createParallelGroup(
		Alignment.LEADING).addGroup(
		gl_chart_panel
			.createSequentialGroup()
			.addComponent(this.chart, GroupLayout.PREFERRED_SIZE,
				194, GroupLayout.PREFERRED_SIZE)
			.addContainerGap(GroupLayout.DEFAULT_SIZE,
				Short.MAX_VALUE)));
	
	this.chart_panel.setLayout(gl_chart_panel);
    }

    /**
     * 
     */
    private void initMenue() {
	JMenuBar menuBar = new JMenuBar();
	this.frame.setJMenuBar(menuBar);
	
	JMenu fileMenue = new JMenu("File");
	menuBar.add(fileMenue);

	JMenuItem exitProgram = new JMenuItem("Exit Program");
	exitProgram.addActionListener(new ActionListener() {
	    @Override
	    public void actionPerformed(ActionEvent e) {
		exitProgram();
	    }
	});

	fileMenue.add(exitProgram);
    }

    protected void switchToDefenseThreshold() {
	switchDefenseComponents(false);
    }

    private void switchDefenseComponents(boolean skill) {
	getDefenceSelected_list().setEnabled(skill);
	getDefenceSelection_list().setEnabled(skill);
	getDefenseSkillTextField().setEnabled(skill);
	getDefenseAdditionalModLbl().setEnabled(skill);
	getDefenseAdditionalModSlider().setEnabled(skill);
	getDefenseAdditionalModTextField().setEnabled(skill);
	getDefenseMovementModLbl().setEnabled(skill);
	getDefenseMovementModSlider().setEnabled(skill);
	getDefenseSkillLbl().setEnabled(skill);
	getDefenseAdd_to_selected_listButton().setEnabled(skill);
	getDefenseRemove_from_selected_list_button().setEnabled(skill);

	getDefenseThresholdTextField().setEnabled(!skill);
	getDefenseThresholdChkBox().setSelected(!skill);
	getDefenseSkillChkBox().setSelected(skill);
    }

    protected void switchToDefenseSkill() {
	switchDefenseComponents(true);
    }

    protected JSlider getAttackSkillThresholdSlider() {
	return this.attackSkillThresholdSlider;
    }

    /**
     * Moves the selected items from the list of selected defense modifiers to
     * the list of available defense modifiers.
     */
    protected void moveFromSelectedListToSelectionList() {
	for (Object selectedObject : getDefenceSelected_list()
		.getSelectedValues()) {
	    DefaultListModel selection_list = (DefaultListModel) getDefenceSelection_list()
		    .getModel();
	    DefaultListModel selected_list = (DefaultListModel) getDefenceSelected_list()
		    .getModel();

	    selected_list.removeElement(selectedObject);
	    selection_list.addElement(selectedObject);
	}
    }

    /**
     * Moves the selected items from the list of available defense modifiers to
     * the list of selected defense modifiers.
     */
    protected void moveFromSelectionListToSelectedList() {
	for (Object selectedObject : getDefenceSelection_list()
		.getSelectedValues()) {
	    DefaultListModel selection_list = (DefaultListModel) getDefenceSelection_list()
		    .getModel();
	    DefaultListModel selected_list = (DefaultListModel) getDefenceSelected_list()
		    .getModel();

	    selected_list.addElement(selectedObject);
	    selection_list.removeElement(selectedObject);
	}
    }

    /**
     * @param lastSelectedClickedTime the lastSelectedClicked to set
     */
    protected void setLastSelectedClicked(long lastSelectedClickedTime) {
	this.lastSelectedClicked = lastSelectedClickedTime;
    }

    /**
     * @param lastSelectionClickedTime the lastSelectionClicked to set
     */
    protected void setLastSelectionClicked(long lastSelectionClickedTime) {
	this.lastSelectionClicked = lastSelectionClickedTime;
    }

    /**
     * Starts the calcualtion of the probabilites for Damage boxes.
     */
    protected void startDamageBoxProbabilityCalculation() {
	ProbabilityParameters parameters = createParamters();

	ProbabilityContainer probabilities = SilhouetteProbabilityCalculation
		.calculateFullProbabilitySet(parameters);

	getResult_textArea().setText(
		probabilities.getDamageBoxProbabilityRepresentation());

	ChartInfo chartInfo = ChartInfoExtractor.DAMAGE
		.extractValues(probabilities);
	String t = "Damage Probability";

	this.chart.updateValues(chartInfo, t);

    }

    /**
     * Starts the calcualtion of the probabilites for Mos.
     */
    protected void startMoSProbabilityCalculation() {
	ProbabilityParameters parameters = createParamters();

	ProbabilityContainer probabilities = SilhouetteProbabilityCalculation
		.calculateFullProbabilitySet(parameters);

	getResult_textArea().setText(
		probabilities.getMoSProbabilityRepresentation());

	ChartInfo chartInfo = ChartInfoExtractor.MOS
		.extractValues(probabilities);
	String t = "MoS Probability";

	this.chart.updateValues(chartInfo, t);
    }

    /**
     * Activates all mods which are used for the attack skill and disactivates
     * all mods used for the attack threshold.
     */
    protected void switchAttackSkillModsOn() {
	// All Attack skill mods enable
	getAttackCoverMods().setEnabled(true);
	getAttackRangeMods().setEnabled(true);
	getAttackAccuracyOfTheWeaponLbl().setEnabled(true);
	getAttackCoverModLbl().setEnabled(true);
	getAttackRangeModLbl().setEnabled(true);
	getAttackMovementModLbl().setEnabled(true);
	getAttackMovementModSlider().setEnabled(true);
	getAttackAdditionalModTextField().setEnabled(true);
	getAccuracySlider().setEnabled(true);
	getAttackAdditionalModSlider().setEnabled(true);
	getAttackAdditionalModLbl().setEnabled(true);
	getAttackSkillChkBox().setSelected(true);
	getAttackMovementModTextField().setEnabled(true);
	getAttackSkillTextField().setEnabled(true);
	getAttackSkillLbl().setEnabled(true);
	getAttackAccuracyModTextField().setEnabled(true);

	// All Attack Threshold mods disable
	getAttackThresholdChkBox().setSelected(false);
	getAttackThresholdTextField().setEnabled(false);
	getAttackThresholdLbl().setEnabled(false);

    }

    /**
     * Disactivates all mods which are used for the attack skill and activates
     * all mods used for the attack threshold.
     */
    protected void switchAttackThresholdModsOn() {

	// All Attack skill mods enable
	getAttackCoverMods().setEnabled(false);
	getAttackRangeMods().setEnabled(false);
	getAttackAccuracyOfTheWeaponLbl().setEnabled(false);
	getAttackCoverModLbl().setEnabled(false);
	getAttackRangeModLbl().setEnabled(false);
	getAttackMovementModLbl().setEnabled(false);
	getAttackMovementModSlider().setEnabled(false);
	getAttackAdditionalModTextField().setEnabled(false);
	getAccuracySlider().setEnabled(false);
	getAttackAdditionalModSlider().setEnabled(false);
	getAttackSkillChkBox().setSelected(false);
	getAttackMovementModTextField().setEnabled(false);
	getAttackAdditionalModLbl().setEnabled(false);
	getAttackSkillTextField().setEnabled(false);
	getAttackSkillLbl().setEnabled(false);
	getAttackAccuracyModTextField().setEnabled(false);

	// All Attack Threshold mods disable
	getAttackThresholdChkBox().setSelected(true);
	getAttackThresholdTextField().setEnabled(true);
	getAttackThresholdLbl().setEnabled(true);
    }

    protected JLabel getAttackThresholdLbl() {
	return this.attackThresholdLbl;
    }

    protected JLabel getAttackSkillLbl() {
	return this.attackSkillLbl;
    }

    protected JTextField getAttackAccuracyModTextField() {
	return this.attackAccuracyModTextField;
    }

    protected JCheckBox getDefenseSkillChkBox() {
	return this.defenseSkillChkBox;
    }

    protected JCheckBox getDefenseThresholdChkBox() {
	return this.defenseThresholdChkBox;
    }

    protected JTextField getDefenseSkillTextField() {
	return this.defenceSkillTextField;
    }

    protected JLabel getDefenseSkillLbl() {
	return this.defenseSkillLbl;
    }

    protected JLabel getDefenceThresholdLbl() {
	return this.defenceThresholdLbl;
    }

    protected JTextField getDefenseThresholdTextField() {
	return this.defenseThresholdTextField;
    }

    protected JTextField getDefenseMovementModTextfield() {
	return this.defenseMovementModTextfield;
    }

    protected JLabel getDefenseMovementModLbl() {
	return this.defenseMovementModLbl;
    }

    protected JSlider getDefenseMovementModSlider() {
	return this.defenseMovementModSlider;
    }

    protected JLabel getDefenseAdditionalModLbl() {
	return this.defenseAdditionalModLbl;
    }

    protected JTextField getDefenseAdditionalModTextField() {
	return this.defenseAdditionalModTextField;
    }

    protected JSlider getDefenseAdditionalModSlider() {
	return this.defenseAdditionalModSlider;
    }

    protected JLabel getLblSelectedDefenceModifiers() {
	return this.lblSelectedDefenceModifiers;
    }

    protected JLabel getLblAvailableDefenceModifiers() {
	return this.lblAvailableDefenceModifiers;
    }

    protected JTextField getDefenceArmorTextField() {
	return this.defenceArmorTextField;
    }

    protected JSlider getDefenseSkillThresholdSlider() {
	return this.defenceSkillThresholdSlider;
    }

    protected JButton getDefenseAdd_to_selected_listButton() {
	return this.add_to_selected_listButton;
    }

    protected JButton getDefenseRemove_from_selected_list_button() {
	return this.remove_from_selected_list_button;
    }

    protected JPanel getChart_paneel() {
	return this.chart_panel;
    }

    /**
     * @return the chckbxAp
     */
    protected JCheckBox getChckbxAp() {
        return this.chckbxAp;
    }

    /**
     * @return the chckbxWeakFacing
     */
    protected JCheckBox getChckbxWeakFacing() {
        return this.chckbxWeakFacing;
    }
}
